<template>
  <div class="common-layout">
    <el-container>
      <el-header>
        <topmargin> </topmargin>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <side-menu>
            <template #orderQuery>
              <span @click="queryfororder()">订单查询</span>
              <!-- <router-link
                :to="{
                  name: 'order',
                  query: {
                    data,
                  },
                }"
                @click="queryforData()"
                >订单查询</router-link
              > -->
            </template>
            <template #ticketQuery>
              <span @click="queryforticket()">车票查询</span>
              <!-- <router-link
                to="/ticket"
                style="text-decoration: none; color: black"
                >车票查询</router-link
              > -->
            </template>
          </side-menu>
        </el-aside>
        <el-main>
          <router-view name="desplace"></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>


<script>
import SideMenu from "./side_menu.vue";
import Topmargin from "./topmargin.vue";
import axios from "axios";
import { ref, nextTick, provide, inject } from "vue";
import { useRouter } from "vue-router";

export default {
  name: "test",
  components: {
    SideMenu,
    Topmargin,
  },
  setup() {
    // const data = ref("你好 query 传参~~~");
    const router = useRouter();
    // const testFun = inject("testFun", Function, false);
    // region
    /* const isRouterAlive = ref(true);
    provide("reload", reload);
    function reload() {
      isRouterAlive.value = false;
      nextTick(function () {
        isRouterAlive.value = true;
      });
    } */
    // unregion
    function queryfororder() {
      router.push({
        path: "/order",
      });
    }
    //origin
    function queryforticket() {
      router.push({
        path: "/ticket",
      });
    }
    //unorigin
    return {
      // data,
      queryfororder,
      // isRouterAlive,
      queryforticket,
    };
  },
};
</script>
